package work.gac.unbind.v2;

import work.gac.unbind.v2.unbinder.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Gong.Yang
 */
public class UnkinderManager {
    List<Unkinder> list = List.of(
            new GacMiniUnbind(),
            new Gac6P0Unbind(),
            new LianWeiUnbind(),
            new GacSZZYUnbind(),
            new WechatUnbind(),
            new JFJCMiniUnbind(),
            new GacHWJFUnbind(),
            new GacChinaArmani99UUnbind()
    );

    public List<Runnable> unbindTask(String thirdCode, String mobile, String tag) {
        List<Runnable> runnables = new ArrayList<>();
        for (Unkinder unkinder : list) {
            if (unkinder.match(tag)) {
                Runnable process = unkinder.process(thirdCode, mobile);
                runnables.add(process);
            }
        }
        return runnables;
    }
}
